/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("float_white_list",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.System.IServices;
using Microsoft.AspNetCore.Authorization;
using VOL.Core.DBManager;
using System.Linq;
using VOL.System.IRepositories;
using VOL.Core.Utilities;
using VOL.Core.Filters;

namespace VOL.System.Controllers
{
    public partial class float_white_listController
    {
        private readonly Ifloat_white_listService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly Ifloat_white_listRepository _whiteListRepository;

        [ActivatorUtilitiesConstructor]
        public float_white_listController(
            Ifloat_white_listService service,
            IHttpContextAccessor httpContextAccessor,
            Ifloat_white_listRepository whiteListRepository
        )
        : base(service)
        {
            _service = service;
            _whiteListRepository = whiteListRepository;
            _httpContextAccessor = httpContextAccessor;
        }
        [HttpPost, Route("GetPageData"), AllowAnonymous]
        [ApiActionPermission()]
        public override ActionResult GetPageData([FromBody] PageDataOptions loadData)
        {

            return base.GetPageData(loadData);
        }


        [HttpPost, Route("getFloatNodeList"), AllowAnonymous]//联动选择流程节点
        public List<dynamic> GetFloatNodeList(Guid id)
        {
            List<dynamic> list = null;
            try
            {
                string sql = "SELECT node_key as [key],value from float_node_list fnl WHERE parentId ='" + id + "';";
                list = DBServerProvider.SqlDapper.QueryList<dynamic>(sql, null).ToList();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return list;
        }

    }
}
